#pragma once
#include"RBTree.h"

template<class K>
class set
{
	struct keyOfT
	{
		K operator()(const K& key)
		{
			return key;
		}
	};
public:
	typedef typename RBTree<K, K, keyOfT>::iterator iterator;
	typedef typename RBTree<K, K, keyOfT>::const_iterator const_iterator;
	typedef typename RBTree<K, K, keyOfT>::reverse_iterator reverse_iterator;
	typedef typename RBTree<K, K, keyOfT>::const_reverse_iterator const_reverse_iterator;

	set()
	{}

	set(const set& s)
	{
		_Tree = s._Tree;
	}

	iterator begin()
	{
		return _Tree.begin();
	}

	iterator end()
	{
		return _Tree.end();
	}

	const_iterator begin() const
	{
		return _Tree.begin();
	}

	const_iterator end() const
	{
		return _Tree.end();
	}

	reverse_iterator rbegin()
	{
		return _Tree.rbegin();
	}

	reverse_iterator rend()
	{
		return _Tree.rend();
	}

	const_reverse_iterator rbegin() const
	{
		return _Tree.rbegin();
	}

	const_reverse_iterator rend() const
	{
		return _Tree.rend();
	}

	bool empty() const
	{
		return _Tree.empty();
	}
	
	size_t size() const
	{
		return _Tree.size();
	}
	
	pair<iterator, bool> insert(const K& key)
	{
		return _Tree.Insert(key);
	}

	void clear() const
	{
		_Tree.~RBTree();
	}

	RBTree<K, K, keyOfT> _Tree;
};